import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import Layout from '@/views/layout/index.vue'
import RolePage from '@/views/role/index.vue'
import LoginPage from '@/views/login/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: Layout,
      //redirect: '/role',
      meta: {
        breadcrumb: '首页',
      },
      children: [
        {
          path: 'role',
          component: RolePage,
          meta: {
            breadcrumb: '角色管理',
          },
        },
        //{
        //  path: 'menu',
        //  component: MenuPage,
        //  meta: {
        //    breadcrumb: '菜单管理'
        //  }
        //}
      ],
    },
    {
      path: '/login',
      component: LoginPage,
      meta: {
        breadcrumb: '登录',
      },
    },
  ],
})

export default router
